-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jit: func_line alignment for line table #9003
Conversation
CT Test Results 3 files 143 suites 49m 40s ⏱️ Results for commit 5295981. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Github actions fail due to formatting errors, please run |
The changes from 5b4457e cause the line table to have extra entries when handling the last_error_offset. The line number from the subsequent function is mapped to the nop instruction following the error, and as a result, the line table suggests that the line is mapped in the former and current range. As an example, if you enable logging in jit-reader.c, and look for sets.erl, you would see something like: ``` Add range `sets:new/0-CodeInfoPrologue` (0x7f5fddf03f18, 0x7f5fddf03f48), 0 lines Add range `sets:new/0` (0x7f5fddf03f48, 0x7f5fddf04008), 3 lines sets.erl:170 sets.erl:171 sets.erl:177 Add range `sets:new/1-CodeInfoPrologue` (0x7f5fddf04008, 0x7f5fddf04038), 0 lines Add range `sets:new/1` (0x7f5fddf04038, 0x7f5fddf04118), 2 lines sets.erl:177 sets.erl:180 ``` which shows that line 177 is included twice, despite only being for sets:new/1. This can also be identified by using this GDB command: `maintenance info line-table sets.erl`. Move func_line back after the func label and emit the last error nop before the label. This ensures that the line is within the (possibly aligned) func range.
e5a9522
to
5295981
Compare
Fixed formatting with a typo fix & ran |
Can this issue also affect function attribution in tools like perf? |
Merged, thanks for the PR! |
The changes from 5b4457e cause the line table to have extra entries when handling the last_error_offset. The line number from the subsequent function is mapped to the nop instruction following the error, and as a result, the line table suggests that the line is mapped in the former and current range.
As an example, if you enable logging in jit-reader.c, and look for sets.erl, you would see something like:
which shows that line 177 is included twice, despite only being for sets:new/1. This can also be identified by using this GDB command:
maintenance info line-table sets.erl
.Move func_line back after the func label and emit the last error nop before the label. This ensures that the line is within the (possibly aligned) func range.